package com.xtianzhuang.www.study2019.elasticSearch;

import java.util.List;
import java.util.Map;

import org.elasticsearch.client.transport.TransportClient;

import com.xtianzhuang.www.study2019.utils.IData;

public interface ElasticSearchService {
	public TransportClient getTransportClient();
	/**
	 * 获取更新、删除的条件
	 *
	 * @param indexName
	 * @param searchCondtions
	 * @return
	 */
	public List<String> getEntityIds(String indexName, IData<String, Object> searchCondtions);

	/**
	 * ES新增
	 *
	 * @param entityInfo
	 * @param indexName
	 * @param _id
	 */
	public void doAdd(Map<String, Object> entityInfo, String indexName, String _id);

	/**
	 * ES更新
	 *
	 * @param entityInfo
	 * @param indexName
	 * @param _id
	 */
	public void doUpdate(Map<String, Object> entityInfo, String indexName, String _id);

	/**
	 * ES删除
	 *
	 * @param indexName
	 * @param _id
	 */
	public void doDelete(String indexName, String _id);
}
